import TabsView from '@/layouts/tabs/TabsView'
import PageView from '@/layouts/PageView'
import BlankView from '@/layouts/BlankView'
import mdm from '@/module/mdm/router'
import mes from '@/module/mes/router'
import wms from '@/module/wms/router'
import qms from '@/module/qms/router'
import tpm from '@/module/tpm/router'
import qrcode from '@/module/qrcode/router'
import demo from './moudle/demo'

// 路由配置
const options = {
  routes: [
    {
      path: '/login',
      name: '登录页',
      component: () => import('@/pages/login')
    },
    {
      path: '*',
      name: '404',
      component: () => import('@/pages/exception/404'),
    },
    {
      path: '/403',
      name: '403',
      component: () => import('@/pages/exception/403'),
    },
    {
      path: '/',
      name: '首页',
      component: TabsView,
      redirect: '/login',
      children: [
        {
          path: 'dashboard',
          name: '工作台',
          meta: {
            icon: 'dashboard'
          },
          component: BlankView,
          children: [
            {
              path: 'workplace',
              name: '首页',
              meta: {
                page: {
                  closable: false
                }
              },
              component: () => import('@/pages/dashboard/workplace'),
            },
            {
              path: 'mrp',
              name: '物控员工作台',
              component: () => import('@/pages/dashboard/analysis'),
            },
            {
              path: 'mes',
              name: '排产员工作台',
              component: () => import('@/pages/dashboard/analysis'),
            },
            {
              path: 'wms',
              name: '仓库工作台',
              component: () => import('@/pages/dashboard/analysis'),
            },
            {
              path: 'qms',
              name: '质量工作台',
              component: () => import('@/pages/dashboard/analysis'),
            },
            {
              path: 'eam',
              name: '设备工作台',
              component: () => import('@/pages/dashboard/analysis'),
            }
          ]
        },
        {
          path: 'mes',
          name: '生产管理',
          meta: {
            icon: 'play-circle',
            page: {
              cacheAble: false
            }
          },
          component: PageView,
          children: mes
        },
        {
          path: 'wms',
          name: '仓储物流',
          meta: {
            icon: 'shopping-cart',
            page: {
              cacheAble: false
            }
          },
          component: PageView,
          children: wms
        },
        {
          path: 'qms',
          name: '质量管理',
          meta: {
            icon: 'eye',
            page: {
              cacheAble: false
            }
          },
          component: PageView,
          children: qms
        },
        {
          path: 'tpm',
          name: '设备维保',
          meta: {
            icon: 'rocket',
            page: {
              cacheAble: false
            }
          },
          component: PageView,
          children: tpm
        },
        {
          path: 'qrcode',
          name: '条码中心',
          meta: {
            icon: 'qrcode',
            page: {
              cacheAble: false
            }
          },
          component: PageView,
          children: qrcode
        },
        {
          path: 'mdm',
          name: '主数据',
          meta: {
            icon: 'form',
            page: {
              cacheAble: false
            }
          },
          component: PageView,
          children: mdm
        },
        {
          path: 'system',
          name: '系统管理',
          meta: {
            icon: 'setting',
            page: {
              cacheAble: false
            }
          },
          component: PageView,
          children: demo
        }
      ]
    },
  ]
}

export default options
